//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class SphereCoordinates : IOfficeXmlSerializable
    {
        private int latitude;

        private int longitude;

        private int revolution;

        public int Latitude
        {
            get { return latitude; }
            set { latitude = value; }
        }

        public int Longitude
        {
            get { return longitude; }
            set { longitude = value; }
        }

        public int Revolution
        {
            get { return revolution; }
            set { revolution = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("rot"))
            {
                Latitude = c.GetInteger("lat");
                Longitude = c.GetInteger("lon");
                Revolution = c.GetInteger("rev");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("rot"))
            {
                c.SetInteger("lat", Latitude);
                c.SetInteger("lon", Longitude);
                c.SetInteger("rev", Revolution);
            }
        }

        #endregion
    }
}